< previous page page_344 next page >

Page 344
Listing 9.16. conntinued
    ' show list
    MsgBox strMsg, vbInformation, "Deleted Field"
    '
    ' clean up
    db.Close
    ws.Close
    Set fl = Nothing
    Set td = Nothing
    Set db = Nothing
    Set ws = Nothing
    '
End Sub
In Listing 9.16, you call the previous code section to create the table again. Then you add a new field using the Append method, and delete that field using the Delete method. Save and run the project, and check your final results against Figure 9.15.
0344-01.jpg
Figure 9.15.
The results of adding
and deleting fields.
Attaching External Data
You can attach an existing external, non-Microsoft Jet database table to an existing Microsoft Jet-format database. Attaching tables in this way gives you access to the external data using the standard Visual Basic data-access object interface. It also enables you to mix Microsoft Jet and non-Microsoft Jet data in the same database, which is great for handling queries that combine data from both sources.
Note.gif
You can create and store queries on the attached external data, too. Queries are covered later in this chapter.

You cannot open a table-type Recordset on an attached table. You must use the Dynaset or Snapshot objects for accessing attached tables. Even though you must use Dynaset data objects, attached tables respond faster than external data links.

 
< previous page page_344 next page >

If you like this book, buy it!